#include "util.h"
#include <guichan.hpp>
#include <guichan/hge.hpp>
#include "map.h"
#include "game.h"
#include "hgeanim.h"
#include "uihelper.h"
#include "gamemain.h"
#include "scene.h"

extern gcn::Rectangle mapviewarea;
namespace Game {
	GameState state;


	void EnterGame()
	{
		MapMgr.Load("test");
		UIHelper::Load();
		MapManager::Instance().SetStartPoint( 1, 0, 0, 0 );
		state.curmap = MapMgr.GetMap( MapManager::Instance().mStartPoint.mapid );
		state.scene = state.curmap->mScene;
		state.scene->mTop = mapviewarea.y;
		state.scene->mLeft = mapviewarea.x;
		state.scene->mWidth = mapviewarea.width;
		state.scene->mHeight = mapviewarea.height;
		state.curlayer = state.curmap->GetLayer( MapManager::Instance().mStartPoint.layer );
		newGame();
		PushGameStack( playRender, playFrame  );
	}
}